<script setup>
import {ref} from "vue";

const emit = defineEmits(['getmessage']);
const inputName =ref(" ")
const setMessage=()=>{
    emit('getmessage',inputName.value);
}
</script>

<template>
<input  v-model="inputName"  >
<button @click="setMessage"> 发送消息到父组件</button>
</template>

<style scoped>

</style>